package com.cm.log_process.log_common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
*@Date 2019/12/10
*@Author 彭文
*作用：日志类（动态索引）
*
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "#{T(com.cm.log_process.log_common.config.ConfigBean).getIndexName()}",type = "log")
public class Log implements Serializable {
    @Id
    @Field(index = false)
    private String id;
    @Field(index = true,type = FieldType.Text)
    private String transId;
    @Field(index = true,type = FieldType.Text)
    private String message;
    @Field(index = true,type = FieldType.Text)
    private String hostIp;
    @Field(index = true,type = FieldType.Text)
    private String timestamp;   // ==== 就是创建时间，而且日志哪里能修改？根本不要修改时间
    @Field(index = true,type = FieldType.Text)
    private String fileType;
}
